<?php
namespace app\Index\Controller;

use \Library\Reqeust;
use \Library\Config;

class Index
{	
	public function index(){
		$data = Db("users")->select();
		return json_encode(["code"=>200,"msg"=>"你好".Config::get("app","webname").",一个真正懂你的轻量级API框架,很小,但很强大!","data"=>$data],JSON_UNESCAPED_UNICODE);
		// return json(["code"=>200,"msg"=>"你好".Config::get("app","webname").",一个真正懂你的轻量级API框架,很小,但很强大!","data"=>$data],JSON_UNESCAPED_UNICODE);
	}
	
	public function hello(){
		$name = Config::get("app","webname");
		echo "<div style='margin-top:30px;margin-left:6px;'><h1>".$name."轻量级API框架</h1><h2>version：".Config::get("app","version")."</h2><h2>date：2021-6-2</h2><h2>Author：".Config::get("app","Author")."</h2><h2 style='color:blue;'><a href='".Config::get("app","url")."'>官网：tianphp.com</a></h2><h2 style='color:blue;'><a href='mailto:".Config::get("app","email")."'>Email：".Config::get("app","email")."</a></h2></div>";
		exit;
	}
	
	public function users(){
		
	}
}
?>